/*
 * Copyright © 2011 SenseForce.com.
 * The Software shall be used for Good, not Evil.
 */

package com.jai2me.foundation;

import java.util.Vector;

/**
 * JAIArray and its subclass JAIMutableArray manage ordered collections of objects called arrays.
 * JAIArray creates static arrays, and NSMutableArray creates dynamic arrays.
 * You can use arrays when you need an ordered collection of objects.
 * @author jcccn
 * @site http://www.senseforce.com/
 */
public class JAIArray {
    private int count = 0;
    private Vector objectsVector = new Vector();


    /**
     * Creates and returns an empty array
     * @return An empty array
     */
    public static JAIArray array() {
        return new JAIArray();
    }

    public static JAIArray arrayWithArray(JAIArray anArray) {
        JAIArray newArray = new JAIArray();
        //TODO to finish the method
        return newArray;
    }

    /**
     * Creates and returns an array containing a given object.
     * @param object An object.
     * @return An array containing the single element anObject.
     */
    public static JAIArray arrayWithObject(Object object) {
        JAIArray newArray = new JAIArray();
        //TODO to finish the method
        return newArray;
    }

    /**
     * Creates and returns an array that includes a given number of objects from a given java array.
     * @param objects A java array of objects.
     * @param count The number of values from the objects java array to include in the new array.
     * @return A new array including the first count objects from objects.
     */
    public static JAIArray arrayWithObjects(Object[] objects, int count) {
        JAIArray newArray = new JAIArray();
        //TODO to finish the method
        return newArray;
    }

    public int count() {
        return count;
    }

}
